function addGauge (name,range,title) {
window.addEvent('domready', function() {
	function loadSwiff(){
		var swiff_obj = new Swiff('../open_js_gauges_1.0/flash/meter_kw.swf', {
			id: 'my'+name,
			width: 230,
			height: 200,
			params: {
				wmode: 'transparent'
			},
			container: $(name), 
			vars: {range: range, title: title}
			});
			//getUpdate();
	}
	
	function getUpdate(){	
			var request = new Request.JSON({
				url: 'data/gauges.php',
				onComplete: function(jsonObj) {
					var mydata = jsonObj[name];
					var barVal = mydata[0].value;
							
					// Update Flash.
					$('my'+name).SetVariable("mValue", barVal);
				}
			}).send();
		}
	loadSwiff();   // add our Flash
	var intUpdate = getUpdate.periodical(10000); // start live update...
});
}